﻿
<CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaAlert Type="AlertTypes.Info" Class="mb-3" Color="tertiary">
    标签可以帮助我们对词条进行分类；可以关注一下标签的层级关系哦，确保添加的都是最后一级的标签
</CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaAlert>

<CnGalWebSite.Components.Containers.MasaTitleContainer Icon="@IconType.Tags.ToIconString()" Title="标签" Class="mb-4" Collapable>
    <CnGalWebSite.Shared.MasaComponent.Shared.Editors.Cards.InputTagListCard AutoCompleteItems="@TagItems" Model="Model.Tags"  @ref="inputTagListTip" OnInput="OnInputList"/>
</CnGalWebSite.Components.Containers.MasaTitleContainer>

<CnGalWebSite.Shared.MasaComponent.Shared.Editors.Cards.SearchTagsCard  Class="@Class" OnInput="OnInputSearch" Model="Model.Tags" @ref="searchTagsViewTip"/>

@code {
    [Parameter]
    public EditEntryTagViewModel Model { get; set; }
    [Parameter]
    public List<string> TagItems { get; set; }
    [Parameter]
    public string Class { get; set; }
    CnGalWebSite.Shared.MasaComponent.Shared.Editors.Cards.InputTagListCard inputTagListTip;
    CnGalWebSite.Shared.MasaComponent.Shared.Editors.Cards.SearchTagsCard searchTagsViewTip;

    public void OnInputSearch()
    {
        if (inputTagListTip != null)
        {
            inputTagListTip.Refresh();
        }
    }

    public void OnInputList()
    {
        if (searchTagsViewTip != null)
        {
            searchTagsViewTip.Refresh();
        }
    }
}
